﻿using System;

namespace Restful.Net
{
    /// <summary>
    /// Attribute used to annotate the methods in the rest service.
    /// Only services annotated with this attribute will be a target of a rest service call.
    /// </summary>
    public class RestMethodAttribute : Attribute
    {
        /// <summary>
        /// Initializes a new instance of the <see cref="RestMethodAttribute"/> class.
        /// Verb defaults to Get.
        /// </summary>
        public RestMethodAttribute()
        {
            Verb = HttpVerb.Get;
        }

        /// <summary>
        /// Gets or sets the verb this Rest method should handle.
        /// HttpVerb.Get is the default.
        /// </summary>
        public HttpVerb Verb
        {
            get;
            set;
        }

        /// <summary>
        /// Gets or sets the URI template that this method should be activated by.
        /// This template should be relative to the base Uri of the service class.
        /// </summary>
        public string UriTemplate
        {
            get;
            set;
        }

        /// <summary>
        /// Gets or sets a value indicating whether or not authentication is required to access this method
        /// default is false
        /// </summary>
        public bool RequiresAuthentication
        {
            get;
            set;
        }
    }
}
